/**
 * Created by cya on 2017/07/07/007.
 */


onmessage=function (message) {
  var data = message.data;
  console.log(data);
  var xmlhttp=new XMLHttpRequest();
  xmlhttp.open("POST","/undo_api_server",true);
  xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  var ServerIp = data['ServerIp'];
  xmlhttp.send("ServerIp="+ServerIp);

  xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4) {
      if (xmlhttp.status == 200 || xmlhttp.status ==0) {
	      postMessage(xmlhttp.responseText);
      } else {
	 throw xmlhttp.status + xmlhttp.responseText;
      }
    }
  }
};
